package com.management.service.Impl;

import com.management.dao.OrderCommodityDao;
import com.management.po.OrderCommodity;
import com.management.service.OrderCommodityService;
import com.management.vo.OrderCommodityVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @category: 订单 商品 业务逻辑实现类
 * @author: cwsheng
 * @version: 1.0
 * @date: 2021/10/30 15:00
 */
@Service
public class OrderCommodityServiceImpl implements OrderCommodityService {
    @Autowired
    OrderCommodityDao orderCommodityDao;

    @Override
    public List<OrderCommodity> findAll() {
        return orderCommodityDao.findAll();
    }

    @Override
    public OrderCommodity findByOrderCommodityId(int orderCommodityId) {
        return orderCommodityDao.findByOrderCommodityId(orderCommodityId);
    }

    @Override
    public OrderCommodity findByOrderFormId(String orderFormId) {
        return orderCommodityDao.findByOrderFormId(orderFormId);
    }

    @Override
    public List<OrderCommodityVO> findByCommodityId(int commodityId) {
        return orderCommodityDao.findByCommodityId(commodityId);
    }

    @Override
    public boolean add(OrderCommodity orderCommodity) {
        return orderCommodityDao.add(orderCommodity)>0?true:false;
    }

    @Override
    public boolean update(OrderCommodity orderCommodity) {
        return orderCommodityDao.update(orderCommodity)>0?true:false;
    }

    @Override
    public boolean delete(int[] arrays) {
        return orderCommodityDao.delete(arrays)>0?true:false;
    }

}
